package com.elitel.frame.base.component.exportprojectdata;

import java.util.Hashtable;

import org.springframework.stereotype.Component;

/**
 * show 用于实时显示进度条单例
 * @author guoyanfei
 * @date 2017/12/11
 */
@Component("progressSingleton")
public class ProgressSingleton {
	//为了防止多用户并发，使用线程安全的Hashtable
	private static Hashtable<Object, Object>  thashtable = new Hashtable<Object,Object>();
	
	/**
	 * show 添加数据
	 * @param key
	 * @param value
	 * @author guoyanfei
	 * @date 2017/12/11
	 */
	public static void put(Object key,Object value){
		thashtable.put(key, value);
	}
	
	/**
	 * show 获取数据
	 * @param key
	 * @return key对应的值
	 * @author guoyanfei
	 * @date 2017/12/11
	 */
	public static Object get(Object key){
		return thashtable.get(key);
	}
	
	/**
	 * show 删除key
	 * @param key
	 * @author guoyanfei
	 * @date 2017/12/11
	 */
	public static void remove(Object key){
		thashtable.remove(key);
	}
	

}
